home *** CD-ROM | disk | FTP | other *** search
/ Sports Illustrated for Kids - Awesome Athletes! / Sports Illustrated for Kids - Awesome Athletes!.iso / tr.dir / 00005_RollOver Detection.ls < prev    next >
Encoding:
Text File  |  1996-04-18  |  7.3 KB  |  257 lines

  1. on RollOverAnswers aWhichAnswer
  2.   global gcTRROVER, gTROutsideMenu
  3.   if the frame <> label("ShowQuestions") then
  4.     return 
  5.   end if
  6.   if aWhichAnswer = 1 then
  7.     set the castNum of sprite gcTRROVER to the number of cast "A:"
  8.     set gTROutsideMenu to 1
  9.   else
  10.     if aWhichAnswer = 2 then
  11.       set the castNum of sprite gcTRROVER to the number of cast "B:"
  12.       set gTROutsideMenu to 1
  13.     else
  14.       if aWhichAnswer = 3 then
  15.         set the castNum of sprite gcTRROVER to the number of cast "C:"
  16.         set gTROutsideMenu to 1
  17.       else
  18.         if (aWhichAnswer = 0) and gTROutsideMenu then
  19.           set the castNum of sprite gcTRROVER to the number of cast "D:"
  20.           set gTROutsideMenu to 0
  21.         end if
  22.       end if
  23.     end if
  24.   end if
  25.   set the locH of sprite gcTRROVER to 168
  26.   set the locV of sprite gcTRROVER to 268
  27.   set the trails of sprite gcTRROVER to 0
  28.   set the visible of sprite gcTRROVER to 1
  29.   updateStage()
  30. end
  31.  
  32. on MenuRollOver aForceUp
  33.   global gTREndGame
  34.   if voidp(aForceUp) then
  35.     set aForceUp to 0
  36.   end if
  37.   set vMenuLoc to list()
  38.   addAt(vMenuLoc, 1, rect(0, 0, 130, 25))
  39.   addAt(vMenuLoc, 2, rect(131, 0, 255, 25))
  40.   addAt(vMenuLoc, 3, rect(256, 0, 385, 25))
  41.   addAt(vMenuLoc, 4, rect(386, 0, 515, 25))
  42.   addAt(vMenuLoc, 5, rect(516, 0, 640, 25))
  43.   if (the mouseV < 23) or aForceUp then
  44.     set vMouse to point(the mouseH, the mouseV)
  45.     puppetSprite(45, 1)
  46.     set the visible of sprite 45 to 1
  47.     repeat with vI = 1 to 5
  48.       if inside(vMouse, getAt(vMenuLoc, vI)) then
  49.         exit repeat
  50.       end if
  51.     end repeat
  52.     if vI = 1 then
  53.       set vCast to "NewGame"
  54.     else
  55.       if vI = 2 then
  56.         set vCast to "HowToPlay"
  57.       else
  58.         if vI = 3 then
  59.           set vCast to "Champs"
  60.         else
  61.           if vI = 4 then
  62.             set vCast to "Player"
  63.           else
  64.             if vI = 5 then
  65.               set vCast to "Sound"
  66.             else
  67.               if not aForceUp then
  68.                 set the visible of sprite 45 to 0
  69.                 puppetSprite(45, 0)
  70.                 exit
  71.               end if
  72.               set vCast to "NewGame"
  73.             end if
  74.           end if
  75.         end if
  76.       end if
  77.     end if
  78.     if mGetPlayMode(gTRGameObj) = 1 then
  79.       set vCast to vCast & "Two"
  80.     else
  81.       set vCast to vCast & "One"
  82.     end if
  83.     if the soundEnabled then
  84.       set vCast to vCast & "Off"
  85.     else
  86.       set vCast to vCast & "On"
  87.     end if
  88.     set the castNum of sprite 45 to cast vCast
  89.     updateStage()
  90.     if the mouseDown then
  91.       set the castNum of sprite 45 to cast (vCast & ".dep")
  92.       updateStage()
  93.       repeat while the mouseDown
  94.         nothing()
  95.       end repeat
  96.       set vMouse to point(the mouseH, the mouseV)
  97.       set vValidLoc to vI
  98.       repeat with vI = 1 to 5
  99.         if inside(vMouse, getAt(vMenuLoc, vI)) then
  100.           exit repeat
  101.         end if
  102.       end repeat
  103.       if vValidLoc <> vI then
  104.         return 
  105.       end if
  106.       if vI = 1 then
  107.         set the visible of sprite 45 to 0
  108.         set gTREndGame to 0
  109.         StartNewGame()
  110.         mSetBeatHighScore(getAt(gzTRPlayerObj, 1), 0)
  111.         mSetBeatHighScore(getAt(gzTRPlayerObj, 2), 0)
  112.         ResetPlayerScores()
  113.         SetPlayerScores()
  114.       else
  115.         if vI = 2 then
  116.           HowToPlay()
  117.         else
  118.           if vI = 3 then
  119.             ShowChampions()
  120.           else
  121.             if vI = 4 then
  122.               if mGetPlayMode(gTRGameObj) = 1 then
  123.                 DoublePlayerGame()
  124.               else
  125.                 SinglePlayerGame()
  126.               end if
  127.             else
  128.               if vI = 5 then
  129.                 set the soundEnabled to not (the soundEnabled)
  130.               end if
  131.             end if
  132.           end if
  133.         end if
  134.       end if
  135.     end if
  136.   else
  137.     set the visible of sprite 45 to 0
  138.     puppetSprite(45, 0)
  139.   end if
  140.   updateStage()
  141. end
  142.  
  143. on RollOverButton aButton
  144.   global gTREndGame, gTRButtInhibit
  145.   if aButton = "NextQuestionButton" then
  146.     set vButtArea to rect(410, 262, 493, 275)
  147.   else
  148.     if aButton = "EnterButton" then
  149.       set vButtArea to rect(446, 229, 493, 249)
  150.     else
  151.       if aButton = "CloseButton" then
  152.         set vButtArea to rect(446, 229, 493, 249)
  153.       else
  154.         if aButton = "NewGame" then
  155.           set vYesArea to rect(434, 266, 463, 281)
  156.           set vNoArea to rect(473, 264, 496, 281)
  157.         else
  158.           if aButton = "Champs" then
  159.             set vATBArea to rect(189, 163, 298, 175)
  160.             set vPBArea to rect(325, 163, 426, 175)
  161.           end if
  162.         end if
  163.       end if
  164.     end if
  165.   end if
  166.   set vMouse to point(the mouseH, the mouseV)
  167.   if aButton = "NewGame" then
  168.     puppetSprite(46, 1)
  169.     repeat while inside(vMouse, vYesArea) and the mouseUp
  170.       set the castNum of sprite 47 to cast "Yes.RollOver"
  171.       updateStage()
  172.       set vMouse to point(the mouseH, the mouseV)
  173.       if the mouseDown then
  174.         set the castNum of sprite 47 to cast "Yes.dep"
  175.         updateStage()
  176.         repeat while the mouseDown
  177.           nothing()
  178.         end repeat
  179.         exit repeat
  180.       end if
  181.     end repeat
  182.     set the castNum of sprite 47 to cast "Yes"
  183.     updateStage()
  184.     repeat while inside(vMouse, vNoArea) and the mouseUp
  185.       set the castNum of sprite 46 to cast "No.RollOver"
  186.       updateStage()
  187.       set vMouse to point(the mouseH, the mouseV)
  188.       if the mouseDown then
  189.         set the castNum of sprite 46 to cast "No.dep"
  190.         updateStage()
  191.         repeat while the mouseDown
  192.           nothing()
  193.         end repeat
  194.         exit repeat
  195.       end if
  196.     end repeat
  197.     set the castNum of sprite 46 to cast "No"
  198.     updateStage()
  199.     puppetSprite(46, 0)
  200.   else
  201.     if aButton = "Champs" then
  202.       repeat while inside(vMouse, vATBArea) and the mouseUp
  203.         set the castNum of sprite 46 to cast "ATB.RollOver"
  204.         updateStage()
  205.         set vMouse to point(the mouseH, the mouseV)
  206.         if the mouseDown then
  207.           set the castNum of sprite 46 to cast "ATB.dep"
  208.           updateStage()
  209.           repeat while the mouseDown
  210.             nothing()
  211.           end repeat
  212.           set vMouse to point(the mouseH, the mouseV)
  213.           if inside(vMouse, vATBArea) then
  214.             go("ChampionsATB")
  215.             exit repeat
  216.           end if
  217.         end if
  218.       end repeat
  219.       set the castNum of sprite 46 to cast "ATB.blank"
  220.       updateStage()
  221.       repeat while inside(vMouse, vPBArea) and the mouseUp
  222.         set the castNum of sprite 46 to cast "PB.RollOver"
  223.         updateStage()
  224.         set vMouse to point(the mouseH, the mouseV)
  225.         if the mouseDown then
  226.           set the castNum of sprite 46 to cast "PB.dep"
  227.           updateStage()
  228.           repeat while the mouseDown
  229.             nothing()
  230.           end repeat
  231.           set vMouse to point(the mouseH, the mouseV)
  232.           if inside(vMouse, vPBArea) then
  233.             go("ChampionsPB")
  234.             exit repeat
  235.           end if
  236.         end if
  237.       end repeat
  238.       set the castNum of sprite 46 to cast "ATB.blank"
  239.       updateStage()
  240.     else
  241.       repeat while inside(vMouse, vButtArea) and the mouseUp
  242.         set the castNum of sprite 47 to cast (aButton & ".RollOver")
  243.         updateStage()
  244.         set vMouse to point(the mouseH, the mouseV)
  245.         if the mouseDown then
  246.           set the castNum of sprite 47 to cast (aButton & ".dep")
  247.           updateStage()
  248.           repeat while the mouseDown
  249.             nothing()
  250.           end repeat
  251.           exit repeat
  252.         end if
  253.       end repeat
  254.     end if
  255.   end if
  256. end
  257.